var num = 0;
let t = setInterval(function() {
  let over = false;
  let nprogress = document.querySelector(".nprogress");
  if (num >= 95 && !over) {
    return;
  }
  num++;
  // console.log(num);

  if (nprogress) {
    nprogress.style.width = num + "%";
  } else {
    let nprogress = document.createElement("div");
    nprogress.className = "nprogress";
    nprogress.style.position = "fixed";
    nprogress.style.top = 0;
    nprogress.style.width = num + "%";
    nprogress.style.height = "5px";
    nprogress.style.backgroundColor = "#29d";
    document.body.appendChild(nprogress);
    // console.log(nprogress, nprogress);
    let nprogressRadius = document.createElement("div");
    nprogressRadius.className = "nprogressRadius";
    document.body.appendChild(nprogressRadius);
  }
  if (num >= 110) {
    document.body.removeChild(nprogress);
    clearInterval(t);
    document.body.removeChild(document.querySelector(".nprogressRadius"));
  }
}, 10);
window.onload = function() {
  over = true;
};
